<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Docker 各个镜像方式单独部署 | Moss代码监控平台文档</title>
    <meta name="description" content="How to initialize moss">
    <meta name="generator" content="VitePress v1.0.0-rc.44">
    <link rel="preload stylesheet" href="/moss-docs/assets/style.BXnyQn6f.css" as="style">
    
    <script type="module" src="/moss-docs/assets/app.DlzODyK7.js"></script>
    <link rel="preload" href="/moss-docs/assets/inter-roman-latin.Bu8hRsVA.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/moss-docs/assets/chunks/framework.DLquJfNR.js">
    <link rel="modulepreload" href="/moss-docs/assets/chunks/theme.H3qLRB7M.js">
    <link rel="modulepreload" href="/moss-docs/assets/moss-docker-normal.md.DKcqlycb.lean.js">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-4c07aa10><!--[--><!--]--><!--[--><span tabindex="-1" data-v-16508274></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-16508274> Skip to content </a><!--]--><!----><header class="VPNav" data-v-4c07aa10 data-v-71e7842d><div class="VPNavBar has-sidebar" data-v-71e7842d data-v-1415e3f0><div class="wrapper" data-v-1415e3f0><div class="container" data-v-1415e3f0><div class="title" data-v-1415e3f0><div class="VPNavBarTitle has-sidebar" data-v-1415e3f0 data-v-ea5c42bd><a class="title" href="/moss-docs/" data-v-ea5c42bd><!--[--><!--]--><!--[--><img class="VPImage logo" src="./logo.svg" alt data-v-df0a4411><!--]--><span data-v-ea5c42bd>Moss代码监控平台文档</span><!--[--><!--]--></a></div></div><div class="content" data-v-1415e3f0><div class="content-body" data-v-1415e3f0><!--[--><!--]--><div class="VPNavBarSearch search" data-v-1415e3f0><!----></div><!----><!----><div class="VPNavBarAppearance appearance" data-v-1415e3f0 data-v-e6213558><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-e6213558 data-v-d896e862 data-v-d46df67b><span class="check" data-v-d46df67b><span class="icon" data-v-d46df67b><!--[--><span class="vpi-sun sun" data-v-d896e862></span><span class="vpi-moon moon" data-v-d896e862></span><!--]--></span></span></button></div><!----><div class="VPFlyout VPNavBarExtra extra" data-v-1415e3f0 data-v-40e0e5ed data-v-34240a2e><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-34240a2e><span class="vpi-more-horizontal icon" data-v-34240a2e></span></button><div class="menu" data-v-34240a2e><div class="VPMenu" data-v-34240a2e data-v-03243d5e><!----><!--[--><!--[--><!----><div class="group" data-v-40e0e5ed><div class="item appearance" data-v-40e0e5ed><p class="label" data-v-40e0e5ed>Appearance</p><div class="appearance-action" data-v-40e0e5ed><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-40e0e5ed data-v-d896e862 data-v-d46df67b><span class="check" data-v-d46df67b><span class="icon" data-v-d46df67b><!--[--><span class="vpi-sun sun" data-v-d896e862></span><span class="vpi-moon moon" data-v-d896e862></span><!--]--></span></span></button></div></div></div><!----><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-1415e3f0 data-v-cf71b2f0><span class="container" data-v-cf71b2f0><span class="top" data-v-cf71b2f0></span><span class="middle" data-v-cf71b2f0></span><span class="bottom" data-v-cf71b2f0></span></span></button></div></div></div></div><div class="divider" data-v-1415e3f0><div class="divider-line" data-v-1415e3f0></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-4c07aa10 data-v-19ab0b9c><div class="container" data-v-19ab0b9c><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-19ab0b9c><span class="vpi-align-left menu-icon" data-v-19ab0b9c></span><span class="menu-text" data-v-19ab0b9c>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-19ab0b9c data-v-04c5830d><button data-v-04c5830d>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-4c07aa10 data-v-117e0bda><div class="curtain" data-v-117e0bda></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-117e0bda><span class="visually-hidden" id="sidebar-aria-label" data-v-117e0bda> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-117e0bda><section class="VPSidebarItem level-0 has-active" data-v-117e0bda data-v-6a4d39de><div class="item" role="button" tabindex="0" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><h2 class="text" data-v-6a4d39de>Moss部署手册</h2><!----></div><div class="items" data-v-6a4d39de><!--[--><section class="VPSidebarItem level-1 is-link has-active" data-v-6a4d39de data-v-6a4d39de><div class="item" tabindex="0" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><a class="VPLink link link" href="/moss-docs/moss-server.html" data-v-6a4d39de><!--[--><h3 class="text" data-v-6a4d39de>Moss Server</h3><!--]--></a><!----></div><div class="items" data-v-6a4d39de><!--[--><div class="VPSidebarItem level-2 is-link" data-v-6a4d39de data-v-6a4d39de><div class="item" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><a class="VPLink link link" href="/moss-docs/moss-docker-normal.html" data-v-6a4d39de><!--[--><p class="text" data-v-6a4d39de>docker镜像方式</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-6a4d39de data-v-6a4d39de><div class="item" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><a class="VPLink link link" href="/moss-docs/moss-docker-compose.html" data-v-6a4d39de><!--[--><p class="text" data-v-6a4d39de>docker-compose方式</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-6a4d39de data-v-6a4d39de><div class="item" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><a class="VPLink link link" href="/moss-docs/moss-static.html" data-v-6a4d39de><!--[--><p class="text" data-v-6a4d39de>用户端</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-117e0bda><section class="VPSidebarItem level-0" data-v-117e0bda data-v-6a4d39de><div class="item" role="button" tabindex="0" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><h2 class="text" data-v-6a4d39de>Moss使用手册</h2><!----></div><div class="items" data-v-6a4d39de><!--[--><div class="VPSidebarItem level-1 is-link" data-v-6a4d39de data-v-6a4d39de><div class="item" data-v-6a4d39de><div class="indicator" data-v-6a4d39de></div><a class="VPLink link link" href="/moss-docs/moss-readme.html" data-v-6a4d39de><!--[--><p class="text" data-v-6a4d39de>待更新</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-4c07aa10 data-v-dfcceb0d><div class="VPDoc has-sidebar has-aside" data-v-dfcceb0d data-v-7870da8b><!--[--><!--]--><div class="container" data-v-7870da8b><div class="aside" data-v-7870da8b><div class="aside-curtain" data-v-7870da8b></div><div class="aside-container" data-v-7870da8b><div class="aside-content" data-v-7870da8b><div class="VPDocAside" data-v-7870da8b data-v-b2bf6950><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" role="navigation" data-v-b2bf6950 data-v-dfbda078><div class="content" data-v-dfbda078><div class="outline-marker" data-v-dfbda078></div><div class="outline-title" role="heading" aria-level="2" data-v-dfbda078>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-dfbda078><span class="visually-hidden" id="doc-outline-aria-label" data-v-dfbda078> Table of Contents for current page </span><ul class="VPDocOutlineItem root" data-v-dfbda078 data-v-46506be3><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-b2bf6950></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-7870da8b><div class="content-container" data-v-7870da8b><!--[--><!--]--><main class="main" data-v-7870da8b><div style="position:relative;" class="vp-doc _moss-docs_moss-docker-normal" data-v-7870da8b><div><h1 id="docker-各个镜像方式单独部署" tabindex="-1">Docker 各个镜像方式单独部署 <a class="header-anchor" href="#docker-各个镜像方式单独部署" aria-label="Permalink to &quot;Docker 各个镜像方式单独部署&quot;">​</a></h1><p>包含 Moss 应用镜像 + mysql 镜像 + redis 镜像</p><hr><h3 id="创建-docker-自定义网络" tabindex="-1">创建 Docker 自定义网络 <a class="header-anchor" href="#创建-docker-自定义网络" aria-label="Permalink to &quot;创建 Docker 自定义网络&quot;">​</a></h3><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> network</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> create</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bridge</span></span></code></pre></div><h3 id="mysql-镜像部署" tabindex="-1">MySql 镜像部署 <a class="header-anchor" href="#mysql-镜像部署" aria-label="Permalink to &quot;MySql 镜像部署&quot;">​</a></h3><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>mySql 要求版本 5.7</p></div><blockquote><p>拉取镜像</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pull</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mysql:5.7</span></span></code></pre></div><blockquote><p>启动容器</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -itd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mysql</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 3307</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:3306</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> MYSQL_ROOT_PASSWORD=WZiBbvYPwoAQLGB50QbV</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --restart=on-failure</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --network</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bridge</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mysql:5.7</span></span></code></pre></div><h3 id="redis-镜像部署" tabindex="-1">Redis 镜像部署 <a class="header-anchor" href="#redis-镜像部署" aria-label="Permalink to &quot;Redis 镜像部署&quot;">​</a></h3><blockquote><p>拉取镜像</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pull</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> redis</span></span></code></pre></div><blockquote><p>启动容器</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -itd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> redis</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 6379</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:6379</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --restart=on-failure</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --network</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bridge</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> redis</span></span></code></pre></div><h3 id="moss-server-镜像部署" tabindex="-1">Moss-Server 镜像部署 <a class="header-anchor" href="#moss-server-镜像部署" aria-label="Permalink to &quot;Moss-Server 镜像部署&quot;">​</a></h3><blockquote><p>加载镜像 tar</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> load</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> moss-server-lastest.tar</span></span></code></pre></div><blockquote><p>启动容器</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -itd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> moss-server</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 7002</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:7002</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /docker/moss/server/logs:/usr/moss/app/logs</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --restart=on-failure</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --network</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bridge</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">  moss-server-lastest</span></span></code></pre></div></div></div></main><footer class="VPDocFooter" data-v-7870da8b data-v-dd9ed44e><!--[--><!--]--><!----><nav class="prev-next" data-v-dd9ed44e><div class="pager" data-v-dd9ed44e><a class="VPLink link pager-link prev" href="/moss-docs/moss-server.html" data-v-dd9ed44e><!--[--><span class="desc" data-v-dd9ed44e>Previous page</span><span class="title" data-v-dd9ed44e>Moss Server</span><!--]--></a></div><div class="pager" data-v-dd9ed44e><a class="VPLink link pager-link next" href="/moss-docs/moss-docker-compose.html" data-v-dd9ed44e><!--[--><span class="desc" data-v-dd9ed44e>Next page</span><span class="title" data-v-dd9ed44e>docker-compose方式</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-4c07aa10 data-v-ca46124a><div class="container" data-v-ca46124a><!----><p class="copyright" data-v-ca46124a>Copyright © 2024-present EvanG</p></div></footer><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"BwqXNPDy\",\"moss-readme.md\":\"2QMUSDKH\",\"moss-docker-normal.md\":\"DKcqlycb\",\"moss-docker-compose.md\":\"DOkfIFdX\",\"moss-static.md\":\"B0eZpaoE\",\"moss-server.md\":\"DzGsNU6W\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Moss代码监控平台文档\",\"description\":\"How to initialize moss\",\"base\":\"/moss-docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"./logo.svg\",\"sidebar\":[{\"text\":\"Moss部署手册\",\"items\":[{\"text\":\"Moss Server\",\"link\":\"/moss-server\",\"items\":[{\"text\":\"docker镜像方式\",\"link\":\"/moss-docker-normal\"},{\"text\":\"docker-compose方式\",\"link\":\"/moss-docker-compose\"}]},{\"text\":\"用户端\",\"link\":\"/moss-static\"}]},{\"text\":\"Moss使用手册\",\"items\":[{\"text\":\"待更新\",\"link\":\"/moss-readme\"}]}],\"footer\":{\"copyright\":\"Copyright © 2024-present EvanG\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
    
  </body>
</html>